﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>WebSocket4Net.AutoJsBridge</title>
    <style type="text/css">
        html, body
        {
            height: 100%;
            overflow: auto;
        }
        body
        {
            padding: 0;
            margin: 0;
        }
        #silverlightControlHost
        {
            height: 100%;
            text-align: center;
        }
    </style>
    <script type="text/javascript" src="Silverlight.js"></script>
    <script type="text/javascript" src="WebSocketEx.js"></script>
    <script type="text/javascript">
        var ws;

        window.onload = function () {
            var websocket = new WebSocketEx('ws://localhost:4502/websocket', function () {
                ws = websocket;
                alert("websocket is opened");
            }, function () {
                alert("websocket is closed");
            }, function (evt) {
                alert(evt.data);
            }, function (evt) {
                alert("error");
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" style="height: 100%">
    <div id="silverlightControlHost" style="width: 0px; height: 0px;"></div>
    </form>
</body>
</html>
